package com.hqyj.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.hqyj.MyApp;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 
 * </p>
 *
 * @author rock
 * @since 2022-10-25 02:07:10
 */
@Getter
@Setter
@TableName("paper_question")
public class PaperQuestion extends MyPage implements Serializable {

    private static final long serialVersionUID = 1L;

    /*
    * type:设置主键生成策略方式：一：IdType.AUTO 表示主键采用自动递增 二：IdType.ASSIGN_UUID 表示主键采用uuId生成策略
    * */
    @TableId(value = "qu_id", type = IdType.ASSIGN_UUID)
    private String quId;

    /**
     * 题目内容
     */
    @TableField("qu_content")
    private String quContent;

    @TableField("qu_aoption")
    private String quAoption;

    @TableField("qu_boption")
    private String quBoption;

    @TableField("qu_coption")
    private String quCoption;

    @TableField("qu_doption")
    private String quDoption;

    /**
     * 题型
     */
    @TableField("qu_type")
    private String quType;

    @TableField("qu_score")
    private Integer quScore;

    @TableField("qu_answer")
    private String quAnswer;

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) throws ParseException {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        if(createTime!=null){
            this.createTime = sdf.parse(createTime);
        }else{
            this.createTime = new Date();
        }

    }

    @JsonFormat(pattern = "yyyy-MM-dd")
    @TableField("create_time")
    private Date createTime;


}
